package org.example.examsystem.mapper;

import org.example.examsystem.entity.Exam ;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.examsystem.entity.Paper;
import org.example.examsystem.entity.StudentExam;

import java.util.List;

@Mapper
public interface ExamMapper {
    List<Exam> getExams(@Param("page") int page, @Param("size") int size);
    int getTotal();
    void addExam(Exam exam);
    void updateExam(Exam exam);
    void deleteExam(int id);
    void batchDeleteExams(@Param("ids") List<Integer> ids);

    void insertExam(Exam exam);
    Exam getExamById(int eid);
    Exam getExamDetailsById(Integer examId);
    //生成试卷
//    Exam getExamById(Integer eid);//上面已实现功能
    List<Paper> getPapersByExamId(Integer eid);
    void insertStudentExam(StudentExam studentExam);
    Integer getLastInsertId();
    void insertStudentSubject(Integer seid, Integer userid, Integer eid, Integer sid, String studentkey);
    int getClassIdByUserId(int userId);

    Exam getAnsweredExamDetails(@Param("examId") Integer examId);
}

